package cn.codecrab.ai.langchain4j.mysql.service.impl;

import cn.codecrab.ai.langchain4j.mysql.entity.Appointment;
import cn.codecrab.ai.langchain4j.mysql.mapper.AppointmentMapper;
import cn.codecrab.ai.langchain4j.mysql.service.AppointmentService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author codecrab
 * @since 2025-05-10
 */
@Service
public class AppointmentServiceImpl extends ServiceImpl<AppointmentMapper, Appointment> implements AppointmentService {

    @Override
    public Appointment getOne(Appointment appointment) {
        return lambdaQuery()
            .eq(Appointment::getUsername, appointment.getUsername())
            .eq(Appointment::getIdCard, appointment.getIdCard())
            .eq(Appointment::getDepartment, appointment.getDepartment())
            .eq(Appointment::getDate, appointment.getDate())
            .eq(Appointment::getTime, appointment.getTime())
            .one();
    }

}
